package com.epalmpay.service.device;

import com.epalmpay.exception.ApplicationException;
import com.epalmpay.dto.terminalmanage.*;
import com.epalmpay.entity.*;

import java.util.Date;
import java.util.List;

/***
 * 设备服务类
 * @author tonywu
 *
 */
public interface IDeviceService {
	
	

	/**获得统计设备列表
	 * @return
	 * @throws Exception
	 */
	public List<DeviceOutDTO> getStatisticsDeviceList(Long groupId, Integer industryID,Date joinStart,Date joinEnd,String name,Page page) throws Exception;


	/**
	 * 添加设备信息
	 * @param addInDTO
	 * @return
	 */
	public int addDeviceInfo(DeviceAddInDTO addInDTO);


	/**
	 * 获取设备列表信息
	 * @param groupPosInDTO
	 * @param page
	 * @return
	 * @throws Exception
     */
	List<GroupPostOutDTO> getDeviceList(GroupPosInDTO groupPosInDTO, Page page) throws Exception;


	/**
	 *更新状态
	 * @param groupPosInDTO
	 * @return
     */
	int updateDevice(GroupPosInDTO groupPosInDTO);


	int updateDeviceInfo(Device device);
	int updateDevicePosInfo(DevicePos devicePos);
	int updateDevicePosById(DevicePos devicePos);
	int updateDevicePosByDeviceId(GroupPosInDTO groupPosInDTO);
	int updateDeviceSmInfo(DeviceAddInDTO deviceSm);
	int updateDeviceDeskInfo(DeviceAddInDTO deviceSm);

	int updateDevicePosRepairStatus(Long posId, Long id, Integer status);

	int delDeviceDeskDetailsById(Long id);
	int delDeviceSmDetailsById(Long id);

	/**
	 * 新增POS维修信息
	 * @param devicePosRepairInDTO
	 * @return
	 */
	int addRepairInfo(DevicePosRepairInDTO devicePosRepairInDTO) throws Exception;

	/**
	 * 根据ID查找device_pos表的状态（强制）
	 * @param groupPosInDTO
	 * @return
	 */
	int updateDevicePosStatusAndDeviceStatus(GroupPosInDTO groupPosInDTO);


	/**
	 * 解绑
	 * @param groupPosInDTO
	 * @return
	 */
	int updateDeviceUnBind(GroupPosInDTO groupPosInDTO);

	/**
	 * 返回关于商户的ID 和 名称 (用于分配)
	 * @param groupPosInDTO
	 * @return
	 * @throws Exception
     */
	List<GroupPostOutDTO> getShopList(GroupPosInDTO groupPosInDTO) throws Exception;


	/**
	 * 获取代理商
	 * @return
	 * @throws Exception
	 */
	List<Agent> getAllAgent() throws Exception;

	public List<GroupPostOutDTO> getAgentIdAndName(Long groupId) throws Exception;
	
	/**
	 * 可绑定门店收银设备
	 * @param deviceInDTO
	 * @return
	 */
	public DeviceListOutDTO selectByPrimaryKey(DeviceInDTO deviceInDTO);


	/**
	 * 根据ID 查找当前的设备信息
	 * @param id
	 * @return
	 */
	DeviceInfoOutDTO getDeviceInfo(Long id);

	DeviceDeskCardDetail getDeviceCardDetailById(Long id);
	
	
	DeviceDeskCard getDeviceDeskCardId(Long id);

	/**
	 * 根据原始posId 查询信息
	 * @param id
	 * @return
	 */
	DeviceInfoOutDTO getDeviceInfoByReplacePosId(Long id);


	/**
	 * 返回新POS信息
	 * @param deviceAddInDTO
	 * @return
	 * @throws Exception
	 */
	DevicePos addDevicePosInfo (DeviceAddInDTO deviceAddInDTO) throws Exception;
	
	
	
	DeviceOutDTO getDeviceGroupId(String deskcardCode,Long deskcardId)  throws ApplicationException;
	
	
	DeviceListOutDTO getByDeviceShopId(Long shopId)throws ApplicationException;

}
